<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<div style="background-image:url('images/blue-gradient.png');text-align: right; valign:top;">
		<a href="home.htm"><img src="images/home.png"/ style="valign:bottom">&nbsp;</a>
		<span style="color:#FFFFFF">Welcome <span><b><sec:authentication property="name"></sec:authentication></b></span></span>
		<sec:authorize ifAllGranted="ROLE_ANONYMOUS">
		<img src="images/offlineUser.png"/>
		<div dojoType="dijit.form.DropDownButton">
			<span><img src="images/login.png"/>Sign In</span>
			<div dojoType="dijit.TooltipDialog" id="tooltipDlg" title="Enter Login information">
				<div dojoType="dijit.form.Form" id="signInForm" jsId="signInForm" action="j_spring_security_check" method="post">
 					<div dojoType="dojox.layout.TableContainer" cols="1" id="tc1" customClass="labelsAndValues">
    					<div dojoType="dijit.form.TextBox" title="Username:" id="j_username" name="j_username"></div>
    					<div dojoType="dijit.form.TextBox" title="Password:" id="j_password" name="j_password" type="password"></div>    
 					</div>
 					<div type="submit" dojoType="dijit.form.Button" id="signInButton">Sign In</div>
					<label>New User? Press Register button.</label>
				</div>
			</div>
		</div>
		</sec:authorize>
		<sec:authorize ifNotGranted="ROLE_ANONYMOUS">
			<img src="images/user.png"/>
			<div dojoType="dijit.form.Form" id="signOutForm" jsId="signOutForm" action="j_spring_security_check" style="display:inline;">
				<div type="submit" dojoType="dijit.form.Button" id="j_acegi_logout" name="j_acegi_logout"><img src="images/logout.png"/>Logout</div>
			</div>
			<div dojoType="dijit.form.Button" onClick="dijit.byId('loadDiv').href='${pageContext.request.contextPath}/userProfile.htm';dijit.byId('loadDiv').reset();dijit.byId('loadDiv').titleNode.innerHTML = 'User Registration';dijit.byId('loadDiv').show(); return false;" id="userProfileButton">								   
				<img src="images/profile.png"/>My Profile
			</div>		
		</sec:authorize>
		<sec:authorize ifAnyGranted="ROLE_ANONYMOUS, ROLE_ADMIN">
			<div dojoType="dijit.form.Button" onClick="dijit.byId('loadDiv').href='${pageContext.request.contextPath}/registerUser.htm';dijit.byId('loadDiv').reset();dijit.byId('loadDiv').titleNode.innerHTML = 'User Registration';dijit.byId('loadDiv').show(); return false;" id="registerButton">								   
				<img src="images/register.png"/>Register
			</div>		
		</sec:authorize>
</div>
<img src="images/logo.png" onclick="location.href='home.htm'" />
<div dojotype="dijit.Dialog" href="" id="loadDiv" preventcache="true" refreshonshow="true" title=""></div>
<script>
// Select the Tools accordion Pane
function select_tools(){
	dojo.addOnLoad(function(){
		var accordion = dijit.byId("accordion_container");
		var accordionToolsPane = dijit.byId("accordion_tools_pane");
		if (accordion != 'undefined') {
			accordion.selectChild(accordionToolsPane);
		}
	});
	
}
dojo.addOnLoad(select_tools);
</script>
